import { get, post, put, del } from '@/utils/request'

const VERSION = 'v1'

export default {
    // 获取省份
    loadProvince: params => get(VERSION, '/province/list', params),
    // 获取城市
    loadCity: params => get(VERSION, '/city/list', params),
    // 获取天气
    loadWeather: params => get(VERSION, '/weather', params),
    // 获取字典信息
    loadDictionary: params => get(VERSION, '/sys/dictionary', params),
    // 获取字典子节点信息
    loadDictionaryChild: params => get(VERSION, '/sys/dictionary/childrens', params),
    // 新增字典信息
    addDictionaryInfo: params => post(VERSION, '/sys/dictionary', params),
    // 更新字典信息
    editDictionaryInfo: params => put(VERSION, '/sys/dictionary', params),
    // 删除字典信息
    deleteDictionaryInfo: params => del(VERSION, '/sys/dictionary', params),

    // 查询用户配置信息
    loadUserConfig: params => get(VERSION, '/sys/user/configinfo', params),
    // 新增用户配置信息
    addUserConfig: params => post(VERSION, '/sys/user/configinfo', params),
    // 更新用户配置信息
    editUserConfig: params => put(VERSION, '/sys/user/configinfo', params),
    // 预览获取token
    previewToken: params => get(VERSION, '/preview/token', params)
}